<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>种植记录加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../style/wangeditor.css">
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">
          {{action=='Add'?'添加'+(dataForm.Type=='0'?'种植':dataForm.Type=='1'?'畜牧养殖':dataForm.Type=='2'?'渔业养殖':'')+'记录':action=='Modify'?'修改'+(dataForm.Type=='0'?'种植':dataForm.Type=='1'?'畜牧养殖':dataForm.Type=='2'?'渔业养殖':'')+'记录':''}}
        </div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'land_crop_record', 'form': 'dataForm' ,'primary_key':'Record_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">土地信息</div>
        </div>
        <el-descriptions :column="1" size="large" border>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">
                {{dataForm.Type=='0'?'种植':dataForm.Type=='1'?'畜牧养殖':dataForm.Type=='2'?'渔业养殖':''}}土地</div>
            </template>
            <yl-select @change="handleLand" v-model="dataForm.Land_SerialNumber" clearable filterable
              :placeholder="'请选择'+(dataForm.Type=='0'?'种植':dataForm.Type=='1'?'畜牧养殖':dataForm.Type=='2'?'渔业养殖':'')+'土地'"
              :options="Land" :props="{value:'Natural_Resource_SerialNumber',label:'Natural_Resource_Name'}">
              <el-table-column prop="Natural_Resource_SerialNumber" width="180" show-overflow-tooltip
                label="自然资源编号"></el-table-column>
              <el-table-column prop="Natural_Resource_Name" width="180" show-overflow-tooltip
                label="自然资源名称"></el-table-column>
              <el-table-column prop="Natural_Resource_Usage_Name" width="180" show-overflow-tooltip
                label="用途"></el-table-column>
              <el-table-column prop="Area" show-overflow-tooltip width="180" label="占地面积"></el-table-column>
              <el-table-column show-overflow-tooltip label="地址">
                <template v-slot="{row}">
                  {{row.Province}}{{row.City}}{{row.County}}{{row.Town}}{{row.Village}}
                </template>
              </el-table-column>
            </yl-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">承包人</div>
            </template>
            <el-input disabled v-model="dataForm.Contractor_Name" class="borderless-input" placeholder="" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">{{dataForm.Type=='0'?'种植':dataForm.Type=='1'?'养殖':dataForm.Type=='2'?'养殖':''}}日期
              </div>
            </template>
            <el-date-picker v-model="dataForm.Plate_Date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
              class="borderless-input" type="date"
              :placeholder="'请选择'+(dataForm.Type=='0'?'种植':dataForm.Type=='1'?'养殖':dataForm.Type=='2'?'养殖':'')+'日期'"
              size="large"></el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">收货日期</div>
            </template>
            <el-date-picker v-model="dataForm.Harvest_Date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
              class="borderless-input" type="date" placeholder="请选择收货日期" size="large"></el-date-picker>
          </el-descriptions-item>
        </el-descriptions>
        <div class="table_titel">
          <div class="titel">{{dataForm.Type=='0'?'种植':dataForm.Type=='1'?'畜牧养殖':dataForm.Type=='2'?'渔业养殖':''}}信息</div>
          <div class="operation">
            <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
            <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
          </div>
        </div>
        <el-descriptions :column="2" style="margin-bottom: 10px;" size="large" border
          v-for="(item,index) in childDataForm" :key="index">
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">
                {{dataForm.Type=='0'?'种植作物':dataForm.Type=='1'?'畜牧养殖':dataForm.Type=='2'?'渔业养殖':''}}</div>
            </template>
            <!-- <el-select clearable v-model.trim="item.Crop_SerialNumber"
              :placeholder="'请选择'+(dataForm.Type=='0'?'种植作物':dataForm.Type=='1'?'畜牧养殖':dataForm.Type=='2'?'渔业养殖':'')"
              filterable style="width: 100%">
              <el-option v-for="(item,index) in Crop" :key="index" :label="item.Crop_Name"
                :value="item.Crop_SerialNumber"></el-option>
            </el-select> -->
            <yl-cascader v-model="item.Crop_SerialNumber"
              :placeholder="'请选择'+(dataForm.Type=='0'?'种植作物':dataForm.Type=='1'?'畜牧养殖':dataForm.Type=='2'?'渔业养殖':'')"
              :options="Crop" :props="{ value:'Crop_Category_SerialNumber', label:'Crop_Category' }"></yl-cascader>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">{{dataForm.Type=='0'?'种植':dataForm.Type=='1'?'养殖':dataForm.Type=='2'?'渔业':''}}面积（亩）
              </div>
            </template>
            <el-input ref="personal_information" v-model="item.Area" class="borderless-input"
              :placeholder="'请输入'+(dataForm.Type=='0'?'种植':dataForm.Type=='1'?'养殖':dataForm.Type=='2'?'渔业':'')+'面积（亩）'" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">{{dataForm.Type=='0'?'总产量（吨）':dataForm.Type=='1'?'出栏量（头）':dataForm.Type=='2'?'渔获量（吨）':''}}
              </div>
            </template>
            <el-input ref="personal_information" v-model="item.Yield" class="borderless-input"
              :placeholder="'请输入' + (dataForm.Type=='0'?'总产量（吨）':dataForm.Type=='1'?'出栏量（头）':dataForm.Type=='2'?'渔获量（吨）':'')" />
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">{{dataForm.Type=='0'?'是否为主种作物':dataForm.Type=='1'?'是否为主种养殖':dataForm.Type=='2'?'是否为主种养殖':''}}
              </div>
            </template>
            <el-switch @change="changeSwitch($event,item)" :disabled="item.Interplant=='0'" v-model="item.Interplant" active-value="0" inactive-value="1" active-text="是" inactive-text="否"></el-switch>
          </el-descriptions-item>
        </el-descriptions>
      </div>

    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>